package com.atguigu.product.config;

import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import org.springframework.web.bind.annotation.ExceptionHandler;

@Configuration
@EnableTransactionManagement
@MapperScan("com.atguigu.product.dao")
public class MyBatisConfig {

    public PaginationInterceptor paginationInterceptor(){
        PaginationInterceptor paginationInterceptor=new PaginationInterceptor();
//        请求页面大于最大页面后返回首页，false是继续请求
        paginationInterceptor.setOverflow(true);
//        每一页数量限制
        paginationInterceptor.setLimit(10000);
        return paginationInterceptor;
    }
}
